home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tools / mg / docs / porting < prev    next >
Text File  |  1995-03-09  |  6KB  |  103 lines

  1. This file contains notes for those working on convincing mg3a to work
  2. on systems using system-dependent code from mg2a.
  3.  
  4. First, the major changes are cosmetic. The first one is that I've
  5. gotten tired of having code formatted with diffent styles for every
  6. person who worked on the code. It's been run through indent, with
  7. everything having the default setting. You can get a copy of indent
  8. from uunet.uu.net. While the format it uses isn't pretty by anyones
  9. standards, it's more readable for all concerned than most of the
  10. formats that were here (mine included), and it's the same everywhere.
  11. Please try and keep changes to the system-indendent code in the style
  12. that indent uses. Better yet, get a copy of indent, and run it over
  13. the file with your changes in it before doing the diffs.
  14.  
  15. Second, all the typedefs for things that aren't system-dependent have
  16. vanished. This allows programmers to see what they are dealing with,
  17. and leads to more readable text by having less upper-case text. The
  18. system-independent code has all been changed to match this useage, as
  19. well as the amiga, bsd & termcap system-dependent code. You can either
  20. add the typdefs back to your sysdef.h, add them to each file that uses
  21. them, or change the system-dependent code to match that useage.
  22.  
  23. Finally, the header files have all been reorganized. Each data
  24. structure (well, set of interdependent data structures) now lives in a
  25. .h file of it's own, and is specifically included by those c source
  26. files that need it. This allows changes in (for instance) one data
  27. structure to be made without make (or similar automatic program
  28. maintenance tools) to want to recompile all the .c files. To aid this,
  29. each of these .h files defins a symbol derived from it's name, and
  30. it's entire contents is #ifdef'ed on that symbol. Likewise, those .h
  31. files that need other .h files have conditional includes on the
  32. symbols defined by the .h file to be included.
  33.  
  34. The first noncosmetic change is related to this. All the various
  35. compile-time #defines that control which features/behavior you get
  36. have moved into seperate .h files, and the .h files should be included
  37. by c source files that which to check those symbols. There's a tool
  38. called config that probably won't run on anything but an Amiga in the
  39. rexx directory that makes maintaining these .h files (among other
  40. things) much simpler. It should be straightforward to rewrite this in
  41. C, if someone is interested. Documentation can be found in the docs
  42. directory.
  43.  
  44. The second noncosmetic change is the reorganization of the directory
  45. structure of mg. Instead of all the source files living in the
  46. top-level directory, with the system-dependent files in sys/<sysname>,
  47. the c sources have moved down a level into "mg"; the include files
  48. have moved down a level into "h", and the directories in sys have
  49. moved up a level. In addition, the following directories are now in
  50. the top level: "conf", holding descriptions of the options available
  51. for all of mg, and for mg on various systems, and with various
  52. compilers.  It's suggested that you build .options files (see the
  53. config doc for an explanation of those) for a version, even if you
  54. don't use config - it documents the options that are available, and
  55. the list of .h files that each version will try and include; "doc"
  56. holding documentation for mg and the stuff in tools; "tools" holding
  57. misc. tools that may or may not be usefull to you in building mg3;
  58. "rexx" which holds Rexx scripts for those Amiga users who build in the
  59. Rexx interface, and hopefully the MS/DOS & OS-2 users after someone
  60. builds in a Rexx interface for mg3 on those machines. Finally, there
  61. is one directory for each version that has been configured out of the
  62. sources in that directory.
  63.  
  64. That last sentence holds the reason for most of this: it's now
  65. possible to maintain multiple mg's with different feature sets out of
  66. the same source tree; it's possible to use different compiler or
  67. compiler flags on the different versions; if you have a system where
  68. disks are shared, you can even maintain versions for different
  69. machines/OS's out of the same source tree.
  70.  
  71. Note that this new structure depends on the ability to specify a list
  72. of directories to search for include files. The list should be:
  73. current directory (if that's not the default), system directory (i.e.,
  74. where sysdef.h lives; for example, /amiga), mg h directory. 
  75.  
  76. The macro code has been completely rewritten, allowing the GNU macro
  77. facilities to be used. To accomodate this, the keymap structure has
  78. been changed. Any locally-provided keymaps will have to be changed to
  79. match the new structure. These changes cause macros to be executed
  80. from inside of the routine that is used to run macros, which has
  81. driven stack use - especially in startup files - up noticably. If you
  82. use macros heavily and have a system that doesn't automatically expand
  83. the stack, you'll want to up the stack size. The amiga version crashes
  84. in the startup-file with a 4K stack. I normally run with a 50K stack,
  85. and have been told that 20K works fine; I don't have any better data,
  86. for which I apologize. Please let me know what's going on.
  87.  
  88. I think that's it. If you find something I forgot to mention, please
  89. let me know.
  90.  
  91. One final comment: I have a fair list of _extensions_ I'd like to
  92. make. However, I feel that it's important to get this version out now,
  93. so people can start beating on it. Likewise, I'd like for real users
  94. to start working on it ASAP. Therefore, I'd like to restrict any
  95. changes to bug fixes, or fixes that needed to get the code to work on
  96. a specific system. If you have extensions you've already made, I'd
  97. prefer to wait for the next update. If you have extensions you'd like
  98. to make, please hold them until after we do a real release. I'd like
  99. to go over everybodies list of extensions, and see which ones want to
  100. get added _after_ it goes out to the real world.
  101.  
  102.     <mike
  103.